<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>

<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
<%@ taglib prefix="ajax" uri="http://ajaxtags.org/tags/ajax"%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/reglas/reglas.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/common/runTimeValidator.js"></script>
<script type="text/javascript"src="<%=request.getContextPath()%>/js/common/prototype-1.6.0.3.js"></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Alta Reglas</title>
</head>
<div style="" id="agregarRegla" >
<table  width="100%" align="center" onkeyup="runTimeValidator.init();">
						
				<ajax:displayTag id="displayTag">
					<display:table size="80%" id="row" name="sessionScope.agregaRegla"
						export="false"  sort="list" class="displayTable"
						style="width:100%;">
						<display:column title="ID" style="font-size: 7pt">
							<input type="hidden" id="idL2${row.id}" value="${row.id}" >
							<c:out value='${row.id}' />
						</display:column>
						<display:column title="ID_REGLA" style="font-size: 7pt">
							<input type="hidden" id="idReglaL2${row.id}" value="${row.idRegla}" >
							<c:out value='${row.idRegla}' />
						</display:column>

						<display:column title="DESCRIPCION">

							<input type="text"  readonly="readonly" id="descripcionL2${row.id}" value="${row.descripcion}"  style="text-transform: uppercase; font-size: 7pt" size="50"/>
						</display:column>

						<display:column title="UNIDAD">
							<input type="text"  readonly="readonly" id="unidadL2${row.id}" value="${row.unidad}"  style="text-transform: uppercase; font-size: 7pt" size="10"/>
						</display:column>
					
						<display:column title="FUENTE">
									<select  disabled="disabled"  id="fuenteL2${row.id}"   style="font-size:10px" >
						 				<c:forEach items="${fuent}" var="opt">
											<option  value="${opt.id}"
											 <c:if test="${row.fuente eq opt.id}">selected="selected"</c:if>  >
											 	${opt.descripcion}
											 </option>
										</c:forEach>
								</select>	
						</display:column>
						<display:column title="ESTATUS COBRO">
						 		<select disabled="disabled" id="estatusCobroL2${row.id}"   style="font-size:10px" >
						 				<c:forEach items="${catEstatus}" var="opt">
											<option value="${opt.idCatalogo}"
											 <c:if test="${row.estatusDispensa eq opt.idCatalogo}">selected="selected"</c:if>  >
											 	${opt.idCatalogoDesc}
											 </option>
										</c:forEach>
								</select>						
						 </display:column>
						 <display:column  title="ESTATUS DISPENSACION">
						 		<select disabled="disabled" name="estatusDispL" id="estatusDispL2${row.id}"   style="font-size:10px" >
										<c:forEach items="${catEstatus}" var="opt">
											<option value="${opt.idCatalogo}"
											 <c:if test="${row.estatusDispensa eq opt.idCatalogo}">selected="selected"</c:if>  >
											 	${opt.idCatalogoDesc}
											 </option>
										</c:forEach>
								</select>					
						 </display:column>
						 <display:column title="PONDERANCIA">
						 			
						 			<input disabled="disabled" type="text"  class="digit_validator"  value="${row.ponderancia}" name="ponderanciaL" maxlength="10" size="3" 
						 					id ="ponderanciaL2${row.id}" onkeypress="return inputValidator.validate(event , 'digits')" 
						 			onkeyup="runTimeValidator.init();"
									onclick="runTimeValidator.init();"/>
						 			
						 </display:column>
						 <display:column title="ESTATUS REGLA">
						 		<select disabled="disabled" name="estatusReglaL" Id="estatusReglaL2${row.id}"   style="font-size:10px" >
										<c:forEach items="${catEstatus}" var="opt">
											<option value="${opt.idCatalogo}"
											 <c:if test="${row.estatusRegla eq opt.idCatalogo}">selected="selected"</c:if>  >
											 	${opt.idCatalogoDesc}
											 </option>
										</c:forEach>
								</select>					
						 </display:column>
												

						
						<display:column media="html xml csv pdf" title="MODIFICAR">
							<a href="#"
								onclick="runTimeValidator.init();validaForm('modifForm',<c:out value="${row.id}"/>);">
								<img src="img/klipper_dock.png" height="13" width="13" />
							</a>
						</display:column>
						<display:column media="html xml csv pdf" title="ELIMINA">
							<a href="#"
								onclick="runTimeValidator.init();eliminaRegla(<c:out value="${row.id}"/>);">
								<img src="images/borrar.png" height="13" width="13" />
							</a>
						</display:column>
						<display:column media="html xml csv pdf" title="ACTUALIZAR">
							<div id='guardar<c:out value="${row.id}"/>'
								onclick="validaForm('actualizaForm', <c:out value="${row.id}"/>);"
								style="visibility: hidden; cursor: hand; cursor: pointer;">
								<img src="img/3floppy_mount.png" border="0">
							</div>
						</display:column>
				

					</display:table>
				</ajax:displayTag>
				
				</table>
		
									
		
</div>	
